joint Derived Type

type, public :: joint

Defines a kinematic joint connecting two links. The joint attaches to a coordinate frame on each of the two links; the frames are identified by their index within each link. The joint is coincident with both frames when all of its joint variables are zero.


Contents


Components

Type Visibility Attributes Name Initial
logical, public :: actuated = .false.

True if the joint is driven; else, false for a passive joint.

integer(kind=int32), public :: child_frame = 1

The index of the coordinate frame on the child link to which the joint attaches.

integer(kind=int32), public :: child_link = 0

The index of the child link.

integer(kind=int32), public :: joint_type = REVOLUTE_JOINT

The type of joint. This value must be one of FIXED_JOINT, REVOLUTE_JOINT, PRISMATIC_JOINT, CYLINDRICAL_JOINT, UNIVERSAL_JOINT, or SPHERICAL_JOINT.

integer(kind=int32), public :: parent_frame = 1

The index of the coordinate frame on the parent link to which the joint attaches.

integer(kind=int32), public :: parent_link = 0

The index of the parent link.


Constructor

public interface joint

  • private function jnt_init(jtype, parent_link, child_link, parent_frame, child_frame, actuated) result(rst)

    Initializes a new joint object.

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int32), intent(in) :: jtype

    The type of joint. This value must be one of FIXED_JOINT, REVOLUTE_JOINT, PRISMATIC_JOINT, CYLINDRICAL_JOINT, UNIVERSAL_JOINT, or SPHERICAL_JOINT.

    integer(kind=int32), intent(in) :: parent_link

    The index of the parent link.

    integer(kind=int32), intent(in) :: child_link

    The index of the child link.

    integer(kind=int32), intent(in), optional :: parent_frame

    The index of the coordinate frame on the parent link to which the joint attaches. If not supplied, a value of one is used.

    integer(kind=int32), intent(in), optional :: child_frame

    The index of the coordinate frame on the child link to which the joint attaches. If not supplied, a value of one is used.

    logical, intent(in), optional :: actuated

    True if the joint is driven. If not supplied, the joint is considered passive.

    Return Value type(joint)

    The resulting joint object.


Type-Bound Procedures

procedure, public :: get_constraint_count => jnt_get_constraint_count

  • private pure function jnt_get_constraint_count(this) result(rst)

    Gets the number of constraint equations the joint imposes upon the relative motion of the two links it connects when considered in three-dimensional space.

    Arguments

    Type IntentOptional Attributes Name
    class(joint), intent(in) :: this

    The joint object.

    Return Value integer(kind=int32)

    The number of constraint equations.

procedure, public :: get_dof => jnt_get_dof

  • private pure function jnt_get_dof(this) result(rst)

    Gets the number of degrees of freedom, and therefore the number of joint variables, permitted by the joint.

    Arguments

    Type IntentOptional Attributes Name
    class(joint), intent(in) :: this

    The joint object.

    Return Value integer(kind=int32)

    The number of degrees of freedom.

procedure, public :: get_planar_constraint_count => jnt_get_planar_count

  • private pure function jnt_get_planar_count(this) result(rst)

    Gets the number of constraint equations the joint imposes upon the relative motion of the two links it connects when the mechanism is restricted to planar motion.

    Arguments

    Type IntentOptional Attributes Name
    class(joint), intent(in) :: this

    The joint object.

    Return Value integer(kind=int32)

    The number of constraint equations.

procedure, public :: is_planar_compatible => jnt_is_planar

  • private pure function jnt_is_planar(this) result(rst)

    Determines if the joint is usable within a planar mechanism. Planar mechanisms admit only fixed joints, revolute joints acting about the plane normal, and prismatic joints acting within the plane.

    Arguments

    Type IntentOptional Attributes Name
    class(joint), intent(in) :: this

    The joint object.

    Return Value logical

    True if the joint may be used in a planar mechanism.

procedure, public :: motion_transform => jnt_motion_transform

  • private function jnt_motion_transform(this, q) result(rst)

    Computes the transformation matrix describing the motion permitted by the joint. The transformation is expressed in, and relative to, the joint's coordinate frame.

    For a planar mechanism the plane of motion is the x-y plane; a revolute joint therefore acts about the z-axis, and a prismatic joint acts along the joint frame's z-axis only when that axis lies in the plane of motion.

    Arguments

    Type IntentOptional Attributes Name
    class(joint), intent(in) :: this

    The joint object.

    real(kind=real64), intent(in), dimension(:) :: q

    An array containing the joint variables. The array must contain at least as many values as the joint has degrees of freedom.

    Return Value real(kind=real64), (4,4)

    The resulting 4-by-4 transformation matrix.